import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router"

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/',
    name: 'Index',
    component: () => import("@/views/Layout.vue"),  // 懒加载
    // children: [
    //   {
    //     path: '',
    //     name: "Home",
    //     component: () => import("@/views/home/index.vue")
    //   },
    //   {
    //     path: 'user',
    //     name: 'User',
    //     component: () => import("@/views/user/index.vue")
    //   },
    //   {
    //     path: 'room',
    //     name: 'Room',
    //     component: () => import("@/views/room/index.vue")
    //   },
    //   {
    //     path: 'device',
    //     name: 'Device',
    //     component: () => import("@/views/device/index.vue"),
    //     children: [
    //       {
    //         path: 'hard',
    //         name: 'Hard',
    //         component: () => import("@/views/device/hard.vue")
    //       },
    //       {
    //         path: 'soft',
    //         name: 'Soft',
    //         component: () => import("@/views/device/soft.vue")
    //       }
    //     ]
    //   }
    // ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/user/login.vue')
  }
]

export default createRouter({
  history: createWebHashHistory(),
  routes      //  简写
})